<div ng-controller="questionListCtrl">
    <!--不能写两个ng-controller:questionListCtrl，否则会导致不能传递参数-->
    <!--相同的ng-controller的操作应该放在同一个div下-->
    <a ng-click="gotoQuestionAddPage()" class="btn-primary btn-sm nodecoration">添加新问题</a>
    </br>
    </br>

    <form class="form-inline" role="form">
        <div class="input-group">
            <label class="control-label">问题关键词：</label>
            <!--ng-model应该进行初始化，否则值为undefined会导致出错-->
            <input type="text" class="form-control" placeholder="问题关键词" ng-model="question.key" ng-init="question.key=''">
        </div><br>

        <div class="control-group">
            <div class="controls">
                <button type="submit" class="btn btn-sm" ng-click="searchQuestion(question)" >搜索</button>
            </div>
        </div>
    </form>

    </br>
    </br>
    <ul class="nav nav-tabs">
        <li class="active"><a href="#tab_a" data-toggle="tab">问题</a></li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="tab_a">
            <table class="table table-condensed">
                <thead>
                <tr>

                    <th>所属小区<!--community--></th>
                    <th>分类<!--category--></th>
                    <th>标签<!--status--></th>
                    <!--<th>标签&lt;!&ndash;tag</th>&ndash;&gt;-->
                    <th>浏览次数<!--browserCount--></th>
                    <th>描述<!--desc--></th>
                    <!--<th>图像&lt;!&ndash;images</th>&ndash;&gt;-->
                    <!--<th>回复&lt;!&ndash;replies</th>&ndash;&gt;-->
                    <!--<th>投票选项&lt;!&ndash;pollOptions</th>&ndash;&gt;-->
                    <!--<th>投票用户列表&lt;!&ndash;pollUserList/th>&ndash;&gt;-->
                    <th>是否有效<!--isValid--></th>
                    <th>创建者<!--createdBy--></th>
                    <th>创建时间<!--dateCreated--></th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionList.data">

                    <td>{{question.community.communityName}}</td>
                    <td>{{question.category}}</td>
                    <td width="150"><span ng-repeat="t in question.tag">{{t}} </span></td>
                    <!--<td>{{question.tag}}</td>-->
                    <td>{{question.browserCount}}</td>
                    <td width="300">{{question.desc}}</td>
                    <!--<td>{{question.images}}</td>-->
                    <!--<td>{{question.replies}}</td>-->
                    <!--<td>{{question.pollOptions}}</td>-->
                    <!--<td>{{question.pollUserList}}</td>-->
                    <td>{{question.isValid}}</td>
                    <td>{{question.createdBy.nickName}}</td>
                    <td>{{question.dateCreated | date:'yyyy-MM-dd'}}</td>

                    <td>
                        <a class="btn btn-danger btn-xs"  ng-click="gotoQuestionEditPage(question.objId)">编辑</a>
                        <a class="btn btn-danger btn-xs"  ng-click="deleteQuestion({objId:question.objId})">删除</a>
                        <a class="btn btn-danger btn-xs"  ng-click="gotoReplyPage(question.objId, question.objId)">查看回复</a>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>

    </div>

</div>